(function(){
	'use strict';

	var module = angular.module('app',[]);
	module.controller('appController',function($scope){
		$scope.data = [];
	
	
	
		$.get("http://10.17.255.28:3000/api/food",
				function(result,status){
				$scope.data = result;
				$scope.$apply();
				
	//			plus.storage.clear();
				for(var i in $scope.data){
					plus.storage.setItem($scope.data[i].id.toString(),$scope.data[i].likes.toString());
				}
	//			alert(plus.storage.getLength());
			    }).error(function(err) {
				   console.log("error")
				   console.dir(err.statusText);
			       });
			
			
			$scope.getLikes = function(x){
			
				$scope.data[x].likes++;
	//			plus.storage.setItem()
	        }
			

      });




















    angular.element(document).ready(function() {
        angular.bootstrap(document,['app']);
    });
    
})();
